package com.ruoyi.project.lely.bean.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;

/**
 * 商品货品
 *
 * @author luoyong
 */
@Data
@ApiModel("商品货品 入参DTO")
public class LyGoodsProductDTO {

    @ApiModelProperty("ID")
    private Long id;

    @NotNull
    @ApiModelProperty("商品表的商品ID")
    private Integer goodsId;

    @Length(max = 1023, message = "商品规格值列表，采用JSON数组格式长度不能超过1023位")
    @NotEmpty
    @ApiModelProperty("商品规格值列表，采用JSON数组格式")
    private String specifications;

    @Digits(integer = 10 - 2, fraction = 2)
    @NotNull
    @ApiModelProperty("商品货品价格")
    private BigDecimal price;

    @NotNull
    @ApiModelProperty("商品货品数量")
    private Integer number;

    @Length(max = 125, message = "商品货品图片长度不能超过125位")
    @ApiModelProperty("商品货品图片")
    private String url;

}
